/************************************************************************
 * The code is owned by mainframer.cn and Shang Tao
 * Without aproval of mainframer.cn and Shang Tao, removing the copyright
 * infomation is regarded as invassion of proprietary copyright
 ***********************************************************************/
package com.mr.qa.util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @deprecated
 */
public final class LoginUtil
{
    private static String IF_DISPLAY_USER_MESSAGES = "IF_DISPLAY_USER_MESSAGES";
    /**
     * @deprecated
     * @param request
     */
    public static void setDisplayUserMessages(HttpServletRequest request)
    {
        request.setAttribute(IF_DISPLAY_USER_MESSAGES,"true");
    }
    public static void setDisplayUserMessages(HttpSession session)
    {
        session.setAttribute(IF_DISPLAY_USER_MESSAGES,"true");
    }

    /**
     * @deprecated
     * @param request
     * @return
     */
    public static boolean getIfDisplayUserMessages(HttpServletRequest request)
    {
        String ifDisplay = (String)request.getAttribute(IF_DISPLAY_USER_MESSAGES);
        if(ifDisplay == null)
        {
            ifDisplay = (String)request.getSession().getAttribute(IF_DISPLAY_USER_MESSAGES);
        }
        if("true".equals(ifDisplay))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    
}
